Change in openvpn[master]: dco_freebsd: Add check_malloc_return after realloc
A message that is not in the archive (sent off-list or not yet received): gerrit.1778102459000.Icd8ea093dfe9f1888570f3d7b786b951b5262e47@...2715...
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1669?usp=email
to review the following change.
Change subject: dco_freebsd: Add check_malloc_return after realloc
......................................................................
dco_freebsd: Add check_malloc_return after realloc
cppcheck complained about a potential memleak
due to realloc failure. But trying to handle that
is probably not useful. Just abort like we do
for other malloc failures.
---
M dev-tools/cppcheck-suppression
M src/openvpn/dco_freebsd.c
2 files changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/69/1669/1
dev-tools/cppcheck-suppression +2 -0
@@ -49,6 +49,8 @@ knownConditionTrueFalse:src/openvpnmsica/dllmain.c:164 # FP: cppcheck seems to be confused since we cast the pointer to integer memleak:src/plugins/down-root/down-root.c:337 +# IGN: we just abort instead +memleakOnRealloc:src/openvpn/dco_freebsd.c:845 # FP: eventmsg.h is not built on Unix missingInclude:src/openvpnserv/common.c:25 # IGN: strlen(NULL) is not nice code, but seems to work
src/openvpn/dco_freebsd.c +1 -0
@@ -842,6 +842,7 @@ retry: buf =realloc (buf, buf_size); +check_malloc_return (buf); drv.ifd_len = buf_size; drv.ifd_data = buf;
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1669?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Icd8ea093dfe9f1888570f3d7b786b951b5262e47
Gerrit-Change-Number: 1669
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Attention is currently required from: flichtenheld, plaisthos.
cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1669?usp=email )
Change subject: dco_freebsd: Add check_malloc_return after realloc
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1669?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Icd8ea093dfe9f1888570f3d7b786b951b5262e47
Gerrit-Change-Number: 1669
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Thu, 07 May 2026 07:52:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
PATCH 1/1 dco_freebsd: Add check_malloc_return after realloc
In reply to a message not in the archiveFrom: Frank Lichtenheld <[email protected]...>
cppcheck complained about a potential memleak
due to realloc failure. But trying to handle that
is probably not useful. Just abort like we do
for other malloc failures.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1669
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1669
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
dev-tools/cppcheck-suppression +2 -0
@@ -49,6 +49,8 @@ knownConditionTrueFalse:src/openvpnmsica/dllmain.c:164 # FP: cppcheck seems to be confused since we cast the pointer to integer memleak:src/plugins/down-root/down-root.c:337 +# IGN: we just abort instead +memleakOnRealloc:src/openvpn/dco_freebsd.c:845 # FP: eventmsg.h is not built on Unix missingInclude:src/openvpnserv/common.c:25 # IGN: strlen(NULL) is not nice code, but seems to work
src/openvpn/dco_freebsd.c +1 -0
@@ -842,6 +842,7 @@ retry: buf =realloc (buf, buf_size); +check_malloc_return (buf); drv.ifd_len = buf_size; drv.ifd_data = buf;
[Openvpn-devel] [PATCH applied] Re: dco_freebsd: Add check_malloc_return after realloc
Good find. Arguably this is a bug, even if in the "unlikely to ever happen" category, so backported to release/2.7 (without the cppcheck file).
Mildy tested on FreeBSD 14 + DCO (... after repairing the t_server setup).
Your patch has been applied to the master and release/2.7 branch.
commit fcc34b135222edf3d53976f406f8db19c19294c0 (master) commit 1a15b3fa51537592bfda1ea588e28f73ded39caf (release/2.7)
Author: Frank Lichtenheld Date: Thu May 7 09:53:15 2026 +0200
dco_freebsd: Add check_malloc_return after realloc
Signed-off-by: Frank Lichtenheld <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1669
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36842.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
Attention is currently required from: flichtenheld, plaisthos.
Hello cron2, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1669?usp=email
to look at the new patch set (#2).
The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied now.
Change subject: dco_freebsd: Add check_malloc_return after realloc
......................................................................
dco_freebsd: Add check_malloc_return after realloc
cppcheck complained about a potential memleak
due to realloc failure. But trying to handle that
is probably not useful. Just abort like we do
for other malloc failures.
---
M dev-tools/cppcheck-suppression
M src/openvpn/dco_freebsd.c
2 files changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/69/1669/2
dev-tools/cppcheck-suppression +2 -0
@@ -62,6 +62,8 @@ knownConditionTrueFalse:src/openvpnmsica/dllmain.c:164 # FP: cppcheck seems to be confused since we cast the pointer to integer memleak:src/plugins/down-root/down-root.c:337 +# IGN: we just abort instead +memleakOnRealloc:src/openvpn/dco_freebsd.c:845 # FP: eventmsg.h is not built on Unix missingInclude:src/openvpnserv/common.c:25 # IGN: strlen(NULL) is not nice code, but seems to work
src/openvpn/dco_freebsd.c +1 -0
@@ -842,6 +842,7 @@ retry: buf =realloc (buf, buf_size); +check_malloc_return (buf); drv.ifd_len = buf_size; drv.ifd_data = buf;
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1669?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Icd8ea093dfe9f1888570f3d7b786b951b5262e47
Gerrit-Change-Number: 1669
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
cron2 has uploaded a new patch set (#3) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1669?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by cron2
Change subject: dco_freebsd: Add check_malloc_return after realloc
......................................................................
dco_freebsd: Add check_malloc_return after realloc
cppcheck complained about a potential memleak
due to realloc failure. But trying to handle that
is probably not useful. Just abort like we do
for other malloc failures.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1669
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36842.html
---
M dev-tools/cppcheck-suppression
M src/openvpn/dco_freebsd.c
2 files changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/69/1669/3
dev-tools/cppcheck-suppression +2 -0
@@ -44,6 +44,8 @@ knownConditionTrueFalse:src/openvpnmsica/dllmain.c:164 # FP: cppcheck seems to be confused since we cast the pointer to integer memleak:src/plugins/down-root/down-root.c:337 +# IGN: we just abort instead +memleakOnRealloc:src/openvpn/dco_freebsd.c:845 # FP: eventmsg.h is not built on Unix missingInclude:src/openvpnserv/common.c:25 # IGN: strlen(NULL) is not nice code, but seems to work
src/openvpn/dco_freebsd.c +1 -0
@@ -842,6 +842,7 @@ retry: buf =realloc (buf, buf_size); +check_malloc_return (buf); drv.ifd_len = buf_size; drv.ifd_data = buf;
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1669?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Icd8ea093dfe9f1888570f3d7b786b951b5262e47
Gerrit-Change-Number: 1669
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1669?usp=email )
Change subject: dco_freebsd: Add check_malloc_return after realloc
......................................................................
dco_freebsd: Add check_malloc_return after realloc
cppcheck complained about a potential memleak
due to realloc failure. But trying to handle that
is probably not useful. Just abort like we do
for other malloc failures.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1669
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36842.html
---
M dev-tools/cppcheck-suppression
M src/openvpn/dco_freebsd.c
2 files changed, 3 insertions(+), 0 deletions(-)
dev-tools/cppcheck-suppression +2 -0
@@ -44,6 +44,8 @@ knownConditionTrueFalse:src/openvpnmsica/dllmain.c:164 # FP: cppcheck seems to be confused since we cast the pointer to integer memleak:src/plugins/down-root/down-root.c:337 +# IGN: we just abort instead +memleakOnRealloc:src/openvpn/dco_freebsd.c:845 # FP: eventmsg.h is not built on Unix missingInclude:src/openvpnserv/common.c:25 # IGN: strlen(NULL) is not nice code, but seems to work
src/openvpn/dco_freebsd.c +1 -0
@@ -842,6 +842,7 @@ retry: buf =realloc (buf, buf_size); +check_malloc_return (buf); drv.ifd_len = buf_size; drv.ifd_data = buf;
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1669?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Icd8ea093dfe9f1888570f3d7b786b951b5262e47
Gerrit-Change-Number: 1669
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>